home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: Transmission / whiteline CD Series - Transmission.iso / utilitys / packer / sentry / sentry2.s < prev    next >
Encoding:
Text File  |  1995-06-07  |  3.5 KB  |  187 lines

  1.     opt x+
  2. ***************************************
  3. * Sentry Packer v2.10 Data Decruncher *
  4. * Coded by Eagle. (29 Jun 1993)       *
  5. * Also works with v2.01 & v2.05, but  *
  6. * this one is faster.                 *
  7. *                                     *
  8. * Source a0, d0: length               *
  9. ***************************************
  10.  
  11. sentry210
  12. ;    move.l    a0,a3        ; remove ';' =>a3: dest.adres!
  13.     lea    (a0,d0.l),a0
  14.     tst.b    -1(a0)
  15.     bne.s    .cont1
  16.     subq.l    #1,a0
  17. .cont1    moveq    #8,d6
  18.     bsr    get_long
  19.     cmpi.l    #'2tnS',d0    ; Snt2
  20.     beq.s    .unpack
  21.     rts
  22. .unpack    bsr    get_long
  23.     lea    (a3,d0.l),a2    ; dest adres
  24.     move.l    a2,a5        ; save for picture depack
  25.     bsr    get_long
  26.     moveq    #0,d1
  27.     bsr    .getbyte
  28.     move.w    d2,unp_pic
  29.     moveq    #0,d1
  30.     bsr    .getbyte
  31.     move.w    d2,unp_sam
  32.     bne.s    .no_sam
  33.     move.l    d0,-(sp)
  34.     bsr    get_long
  35.     move.l    d0,samoff+4
  36.     bsr    get_long
  37.     move.l    d0,samoff
  38.     move.l    (sp)+,d0
  39. .no_sam    bsr.s    .unp_loop    ; unpack data
  40.     tst    unp_pic
  41.     bne.s    .no_pic
  42.     bsr    unp_picture
  43. .no_pic    tst    unp_sam
  44.     bne.s    .no_mod
  45.     bsr    samples
  46. .no_mod    rts
  47.  
  48. .unp_loop
  49.     bsr.s    .getbit
  50. .cont    bcs.s   .blocks
  51.     bsr.s    .getbit
  52.     bcs.s    .copy_2
  53.     move.b    -(a0),-(a2)    ; 1 byte copy
  54.     bra    .l_col
  55. .copy_2    bsr.s    .getbit
  56.     moveq    #1,d2        ; copy 2 bytes
  57.     bcc.s    .copy
  58. .c_more    lea    copy_tab(pc),a4
  59. .c_loop    move.l    (a4)+,d1
  60.     bsr.s    .getbyte        ; haal aantal
  61.     subq.w    #1,d2
  62.     bmi.s    .c_loop
  63. .found    swap    d1
  64.     add.w    d1,d2
  65.  
  66. .copy    move.b    -(a0),-(a2)
  67.     dbf    d2,.copy
  68.     bra    .l_col
  69.  
  70. .get_off
  71.     MOVEQ    #1,D1        ;OFFSET
  72.     BSR.S    .getbyte
  73.     move.b    (a4,d2),d1    ; bits
  74.     ADD.W    D2,D2            ; remove for MC6830
  75.     ext.w    d1
  76.     move.w    4(a4,d2),d4        ; MC68030: move.w 4(a4,d2.w*2),d4
  77.     bsr.s    .getbyte
  78.     add.w    d4,d2
  79.     rts
  80. .getbit    add.l    d0,d0    ;LSR.L    #1,D0
  81.     beq.s    .haha
  82.     rts
  83. .haha    bsr.s    get_long
  84.     addx.l    d0,d0    ;ROXR.L  #1,D0
  85.     rts
  86. .haha1    bsr.s    get_long
  87.     addx.l    d0,d0    ;ROXR.L  #1,D0
  88.     bra.s    .getbyt
  89. .getbyte
  90.     CLR.W   D2
  91. .loop    add.l    d0,d0    ;LSR.L    #1,D0
  92.     beq.s    .haha1
  93. .getbyt    addx.L  d2,D2 
  94.     DBF     D1,.loop
  95.     RTS
  96.  
  97. .blocks    bsr.s    .getbit
  98.     bcs.s    .string3
  99.     moveq    #1,d3        ; 2 bytes-string
  100.     moveq    #8-1,d1    ; small-bits-offset
  101.     bra.s    .string_copy
  102. .string3
  103.     lea    small_offset(pc),a4
  104.     bsr.s    .getbit
  105.     bcs.s    .string_more
  106.     moveq    #2,d3        ; 3 bytes-string
  107.     bra.s    .do_strings
  108. .string_more
  109.     moveq    #1,d1        ; 2 bits-commando
  110.     bsr.s    .getbyte
  111.     subq.w    #1,d2        ; large string?
  112.     bmi.s    .large
  113.     moveq    #3,d3        ; minimaal 4 bytes-string
  114.     add.w    d2,d3        ; meer?
  115.     bra.s    .do_strings
  116. .large    lea    aantal_tab(pc),a4
  117.     bsr.s    .get_off
  118.     move.w    d2,d3
  119.     lea    offset_tab(pc),a4
  120. .do_strings
  121.     bsr.s    .get_off
  122.     bra.s    .s_copy
  123. .string_copy
  124.     bsr.s    .getbyte
  125. .s_copy    move.b    -1(a2,d2.w),-(a2) 
  126.     dbf    d3,.s_copy
  127.  
  128. .l_col    cmpa.l    a2,a3 
  129.     blt    .unp_loop
  130. ex_unp    RTS
  131. get_long
  132.     move.b    -(a0),d0
  133.     lsl.l    d6,d0
  134.     move.b    -(a0),d0
  135.     lsl.l    d6,d0
  136.     move.b    -(a0),d0
  137.     lsl.l    d6,d0
  138.     move.b    -(a0),d0
  139.     move.w    #$10,ccr
  140.     rts
  141. samples    lea    samoff(pc),a1
  142.     move.l    a3,a0        ; source adres
  143.     add.l    (a1)+,a0
  144.     move.l    (a1),d0
  145.     lea    (a0,d0.l),a2
  146. .loop    move.b    (a0)+,d0
  147.     sub.b    d0,(a0)
  148.     neg.b    (a0)
  149.     cmp.l    a2,a0
  150.     blt.s    .loop
  151.     rts
  152. unp_picture
  153. .low    move.w    #$0f9f,d7
  154. snt2_01    moveq    #3,d6
  155. snt2_02    move.w    -(a5),d4
  156.     moveq    #3,d5
  157. snt2_03    add.w    d4,d4
  158.     addx.w    d0,d0
  159.     add.w    d4,d4
  160.     addx.w    d1,d1
  161.     add.w    d4,d4
  162.     addx.w    d2,d2
  163.     add.w    d4,d4
  164.     addx.w    d3,d3
  165.     dbra    d5,snt2_03
  166.     dbra    d6,snt2_02
  167.     movem.w d0-d3,(a5)
  168.     dbra    d7,snt2_01
  169.     rts
  170. samoff    dc.l    0,0
  171. unp_pic    dc.w    0
  172. unp_sam    dc.w    0
  173. offset_tab
  174.     dc.b    5-1,8-1,9-1,13-1
  175.     dc.w    1,1+32,1+32+256,1+32+256+512
  176. aantal_tab
  177.     dc.b    2-1,3-1,5-1,9-1
  178.     dc.w    6,6+4,6+4+8,6+4+8+32
  179. small_offset
  180.     dc.b    4-1,5-1,7-1,9-1
  181.     dc.w    1,1+16,1+16+32,1+16+32+128
  182. copy_tab
  183.     dc.w    2,1
  184.     dc.w    5,2
  185.     dc.w    12,3
  186.     dc.w    27,4
  187.